class EventBus {
  constructor() {
    this.eventList = {};
  }

  $on(eventName, fn) {
    this.eventList[eventName] = fn;
  }

  $emit(eventName, ...args) {
    this.eventList[eventName]?.(...args);
  }
}

export default new EventBus();